<?php
	$dbhost = 'localhost';
	$db_user = 'deploy';
	$db_password = 'deploy';
	$dbname = 'k9deploy_new';
	$con = mysql_connect($dbhost,$db_user,$db_password);
	if(!$con)
	{	
		echo "mysql connect failed.";
	}
	mysql_select_db($dbname,$con);
	$sql = "select  db_name from  db_info where db_flag = 1";
	$result = mysql_query($sql);
	while($row = mysql_fetch_assoc($result)){
		$result_arr[] = $row['db_name'];
	}
	mysql_close($con);
	
$databases = json_encode($result_arr);
system("./add_product_cn_db_config.sh ${databases}");
system("./add_sandbox_cn_db_config.sh ${databases}");
system("./add_development_cn_db_config.sh ${databases}");
system("./add_sbpre_cn_db_config.sh ${databases}");
